package com.ogawa.chair7808.utils;

import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.easepal.softaplib.wifi.WiFiManager;
import com.example.reslib.utils.ToastUtils;
import com.ogawa.chair7808.ui.activity.AdvancedMassageActivity7808;
import com.ogawa.chair7808.ui.activity.AttitudeAdjustmentActivity7808;
import com.ogawa.chair7808.ui.activity.Home7808Activity7808;
import com.ogawa.chair7808.ui.activity.ProMasDetailActivity7808;
import com.ogawa.chair7808.ui.activity.ProfessionalMassageActivity7808;
import com.ogawa.chair7808.ui.activity.ScanShoulderActivity7808;
import com.ogawa.chair7808.ui.activity.ShouldersAdjustmentActivity7808;
import com.ogawa.chair7808.ui.activity.SoftApActivity;
import com.ogawa.chair7808.ui.activity.SoftApOldActivity;


/**
 * Created by FHB on 2018/3/26.
 */

public class Activity7808Utils {
    public static void startHomeActivity(Context mContext) {
        Intent intent = new Intent(mContext, Home7808Activity7808.class);
        mContext.startActivity(intent);
    }
    public static void startHomeActivityClearTop(Context mContext) {
        Intent intent = new Intent(mContext, Home7808Activity7808.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
        mContext.startActivity(intent);
    }


    public static void startProfessionMassaActivity(Context mContext) {
        Intent intent = new Intent(mContext, ProfessionalMassageActivity7808.class);
        mContext.startActivity(intent);

    }


    /**
     * 肩部检测
     *
     * @param mContext
     */
    public static void startScanShoulderActivity(Context mContext) {
        Intent intent = new Intent(mContext, ScanShoulderActivity7808.class);
        mContext.startActivity(intent);
    }


    /**
     * 肩部调整
     *
     * @param mContext
     */
    public static void startShouldersAdjustmentActivity(Context mContext) {
        Intent intent = new Intent(mContext, ShouldersAdjustmentActivity7808.class);

        mContext.startActivity(intent);
    }

    /**
     * 专业按摩详情7506
     *
     * @param mContext
     */
    public static void startProMasDetailActivity(Context mContext, String name) {
        Log.e("startActivity", "startProMasDetailActivity");
        Intent intent = new Intent(mContext, ProMasDetailActivity7808.class);
        intent.putExtra("name", name);
        mContext.startActivity(intent);
    }


    /**
     * 高级按摩
     *
     * @param mContext
     */
    public static void startAdvancedMassageActivity(Context mContext) {
        Intent intent = new Intent(mContext, AdvancedMassageActivity7808.class);
        mContext.startActivity(intent);
    }


    /**
     * 姿态调节
     *
     * @param mContext
     */
    public static void startAttitudeAdjustmentActivity(Context mContext) {
        Intent intent = new Intent(mContext, AttitudeAdjustmentActivity7808.class);
        mContext.startActivity(intent);
    }

    /**
     * 配网
     *
     * @param mContext
     */
    public static void startSoftApActivity(Context mContext) {
        if(!WiFiManager.getInstance(mContext).isWifiEnabled()){
            ToastUtils.showShortToast(mContext,"请先开启wifi");
        }else {
            Intent intent;

//        intent = new Intent(mContext, SoftApOldActivity.class);
            intent = new Intent(mContext, SoftApActivity.class);
            mContext.startActivity(intent);
        }

    }
}
